The present invention pertains to computer simulation in a network environment. More particularly, the present invention relates to providing computer simulation with high consistency, responsiveness, and security in a distributed network environment.
In discrete event simulation, a machine performing simulation, such as a computer system, maintains the state of various simulation objects that can be displayed on a display device, such as a computer monitor. These objects may represent real-world objects, such as people, vehicles, etc., which may be controlled by a human user. The state of an object may include the object""s display position on a display device, its physical orientation, size, shape, color, etc. The machine normally evolves the state of an object over time based on three factors: 1) user input; 2) object-internal rules for advancing the object""s state (which may be general laws of physics and/or object-specific behaviors); and 3) rules for interaction with other objects (which again may be based on laws of physics or may be specific to the interacting objects).
In distributed discrete event simulation, each object may be known to multiple machines, each with its own version of the object""s state. Distributed simulation presents three challenges. First, because of variable communication delay, different machines become aware of events affecting an object at different points in (physical) time. There is unavoidable delay between the machine where a command is issued and another user""s machine where the affected object is being observed. Thus, a major challenge of distributed simulation is providing a consistent view of simulation state across all machines.
Second, mechanisms that improve consistency generally involve reaching agreement about the progress of simulation before displaying it to the user. This delay may result in poor responsiveness, i.e., excessive delay between when the user issues a command and when the response is apparent.
Third, attempting to improve responsiveness by granting the user""s machine authority over the state the user can influence may result in an integrity problem: the user may modify the program on his machine to corrupt the simulation state over which his machine has authority, degrading the experience for other users.
The present invention includes a method and apparatus that provide consistency, responsiveness, and integrity for a network-based simulation of physical objects. Among other features, the ability to run different parts of a shared computation at varying times on different machines is provided.
In particular, the present invention includes a method and apparatus for maintaining a simulation distributed on a network and characterized by multiple objects. A true state of each of the objects is maintained on a server on the network. User commands are sent from a client on the network to the server and are associated with timestamps. Essentially identical computations of object state are performed on the server and the client to achieve essentially the same result on the server and the client. However, corresponding computations on the client and the server may be performed at different times.
In another aspect of the present invention, the simulation is advanced according to global virtual time. In a local processing system, at each of multiple points in global virtual time, a state of one of the objects is computed for a time that differs from the current global virtual time. The object is displayed according to each computed state.
In yet another aspect of the present invention, a repair message is received from a remote processing system, such as a server on the network. The repair message includes an indication of a true state of an object and a time value associated with the true state. Previously computed states of the object are then recomputed based on the repair message.
In still another aspect of the present invention, a time frame for a current state of an object is determined based on a proximity of the object to another object with which the object can interact.
In another aspect of the present invention, a frame of reference of an object is determined as a region in which the object can exist. A determination is made of when the object contacts the frame of reference. When the object contacts the frame of reference, the position of the object is transformed from an original position associated with a first time frame to a new position associated with a time frame of the frame of reference.
In another aspect of the present invention, objects are simulated in accordance with a hierarchical classification system that restricts the set of objects that any given object can affect.
Other features of the present invention will be apparent from the accompanying drawings and from the detailed description which follows.